package system;

import system.communication.HandController;
import system.communication.Monitor;
import system.ui.Engine;
import system.ui.Gui;

/**
 * EvilOverlord manages all parts of the train operation apparatus.
 * 
 * @author (Erin Blockley) 
 * @version (February 2, 2009)
 */

public class EvilOverlord
{
    /**
     * This method will instantiate the train system.
     * 
     * @param args  the default String array
     */
    public static void main(String[] args)
    {
        System.out.println("Hello World!  I am a train!");
        Engine theEngine = Engine.getInstance();
        Gui controlPanel = new Gui(theEngine);
        theEngine.setGui(controlPanel);
        //Doing this last lets us post the statuses fron
        //construction of the track to the GUI.
        theEngine.init();

        //Create and register hand controllers.
        Monitor.getInstance().getMessageListener()
                .registerHC1(new HandController(1));
        Monitor.getInstance().getMessageListener()
                .registerHC2(new HandController(2));

        //Prime the controllers with a message.
        Monitor.getInstance().getHandControlStatus(1);
        Monitor.getInstance().getHandControlStatus(2);
    }
}